home *** CD-ROM | disk | FTP | other *** search
/ Cre@te Online 2000 December / Cre@teOnline CD05.iso / MacSoft / XML ConsoleMax.sea / XML ConsoleMax / Required / esc.jar / com / extensibility / xml / DDMLWriter$AttrProxy.class (.txt) < prev    next >
Encoding:
Java Class File  |  2000-06-30  |  2.5 KB  |  71 lines

  1. package com.extensibility.xml;
  2.  
  3. import java.util.Enumeration;
  4.  
  5. public class DDMLWriter$AttrProxy extends DDMLWriter.DeclProxy {
  6.    // $FF: synthetic field
  7.    final DDMLWriter this$0;
  8.    AttributeDeclaration decl;
  9.  
  10.    DDMLWriter$AttrProxy(DDMLWriter var1) {
  11.       super((DDMLWriter)null);
  12.       this.this$0 = var1;
  13.    }
  14.  
  15.    DDMLWriter$AttrProxy(DDMLWriter var1, AttributeDeclaration var2) {
  16.       super((DDMLWriter)null);
  17.       this.this$0 = var1;
  18.       this.setDecl(var2);
  19.    }
  20.  
  21.    void setDecl(AttributeDeclaration var1) {
  22.       this.decl = var1;
  23.       super.setDecl(var1);
  24.    }
  25.  
  26.    public void write(SXE var1, boolean var2) {
  27.       this.writeType(var1, var2);
  28.    }
  29.  
  30.    void writeType(SXE var1, boolean var2) {
  31.       var1.writeElem("AttDef", -1);
  32.       ((DDMLWriter.DeclProxy)this).writeNameAttr(var1);
  33.       if (!this.decl.getDataType().equals(1)) {
  34.          var1.writeAttr("Type", this.this$0.getType(this.decl.getTypeAsPrimitiveSource()));
  35.       }
  36.  
  37.       if (this.decl.getDefault() != null) {
  38.          var1.writeAttr("AttValue", this.decl.getDefault());
  39.       }
  40.  
  41.       if (this.decl.getRequired()) {
  42.          var1.writeAttr("Required", "Yes");
  43.       }
  44.  
  45.       if (var2) {
  46.          ((DDMLWriter.DeclProxy)this).writeComments(var1);
  47.       }
  48.  
  49.       if (!this.decl.isPrimitive()) {
  50.          ((DDMLWriter.DeclProxy)this).writeMore(var1, this.decl.getDataType());
  51.       }
  52.  
  53.       if (this.decl.getDataType().isEnumeration() || this.decl.getDataType().isNotation()) {
  54.          Enumeration var3 = this.decl.getChoices(this.this$0.schema, true);
  55.          if (var3.hasMoreElements()) {
  56.             var1.writeElem("Enumeration", -1);
  57.  
  58.             while(var3.hasMoreElements()) {
  59.                String var4 = (String)var3.nextElement();
  60.                var1.writeElem("EnumerationValue", true);
  61.                var1.writeAttr("Value", var4);
  62.             }
  63.  
  64.             var1.flush("Enumeration");
  65.          }
  66.       }
  67.  
  68.       var1.flush("AttDef");
  69.    }
  70. }
  71.